/*
 * @Author: intellectual-seeker 3336339701@qq.com
 * @Date: 2025-09-15 21:11:18
 * @LastEditors: intellectual-seeker 3336339701@qq.com
 * @LastEditTime: 2025-09-16 22:35:10
 * @FilePath: /code/lesson33/ThreadPool/LockGuard.hpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef LOCKGUARD_HPP
#define LOCKGUARD_HPP

#include <pthread.h>

class LockGuard
{
public:
    LockGuard(pthread_mutex_t& mutex)
        :_mutex(mutex)
    {
        pthread_mutex_init(&_mutex, nullptr);
    }

    ~LockGuard()
    {
        pthread_mutex_destroy(&_mutex);
    }

private:
    pthread_mutex_t _mutex;
};

#endif